<?php
	require_once('config.php');
	if(isset($_GET['query_num'])){
			$message = '<div align="left" style="width: 100%; margin-left: 5% ">';
		if($_GET['query_num'] < count($queries)){
			$query = $queries[$_GET['query_num']];
			foreach($query as $name => $value) {
				if($name=="post" || $name=="term") continue;
				$message .= "<b><label style=\"width: 10%; float: left\">$name:</label></b>";
				if($name=='term')
					$message .= "<textarea row=\"3\" col=\"50\" id=\"$name\" name=\"$name\" style=\"margin-left: 10%; width: 60%\">". str_replace("\"", "", $value) . "</textarea><br>";
				else
					$message .= "<input type=\"text\" id=\"$name\" name=\"$name\" value=\"" . str_replace("\"", "", $value) . "\" style=\"margin-left: 10%; width: 60%\" /><br>";
			}
				$message .= "<b><label style=\"width: 10%; float: left\">email:</label></b><input type=\"text\" id=\"email\" name=\"email\" value=\"" . str_replace("\"", "", $email) . "\" style=\"margin-left: 10%; width: 60%\" /><br>";
				$message .= "<b><label style=\"width: 10%; float: left\">user:</label></b><input type=\"text\" id=\"user\" name=\"user\" value=\"" . str_replace("\"", "", $user) . "\" style=\"margin-left: 10%; width: 60%\" /><br>";
				$message .= "<b><label style=\"width: 10%; float: left\">pass:</label></b><input type=\"text\" id=\"pass\" name=\"pass\" value=\"". str_replace("\"", "", $pass) . "\" style=\"margin-left: 10%; width: 60%\" /><br>";
			if(strstr($query['post'], 'first_name') != false ){
				$message .= "<b><label style=\"width: 10%; float: left\">firstname:</label></b><input type=\"text\" id=\"firstname\" name=\"firstname\" value=\"". $firstname . "\" style=\"margin-left: 10%; width: 60%\" /><br>";
			}
			if(strstr($query['post'], 'last_name') != false ){
				$message .= "<b><label style=\"width: 10%; float: left\">lastname:</label></b><input type=\"text\" id=\"lastname\" name=\"lastname\" value=\"". $lastname . "\" style=\"margin-left: 10%; width: 60%\" /><br>";
			}
		}else{
			$message .= '<label><b>Invalid query</b></label>';
		}
		$message .= '</div>';
		echo $message;
	}
